import 'package:flutter/material.dart';
import '../../widgets/grid_wrap.dart';
import '../../widgets/block_widget.dart';
import '../../widgets/tags/menu_item.dart';

import 'backdrop.dart';
import 'dragable.dart';
import 'progress.dart';
import 'silver.dart';
import 'constrained_box.dart';
import 'decorated_box.dart';
import 'fitted.dart';
import 'geolocator.dart';
import 'simple_dialog.dart';
import 'search.dart';
import 'chips.dart';
import 'gallery.dart';

class IndexPage extends StatelessWidget {
  const IndexPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final colorScheme = Theme.of(context).colorScheme;
    return BlockWidget(
      margin: const EdgeInsets.all(20),
      decoration: BoxDecoration(
        color: colorScheme.surface,
        borderRadius: const BorderRadius.all(Radius.circular(5)),
      ),
      title: const BlockTitle(
        title: Text('实验室'),
      ),
      child: GridWrap(
        crossAxisCount: 4,
        children: [
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const ProgressPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Progress',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const DragablePage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Gesture Drag',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const SilverPage()),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Sliver',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const BackdropPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'BackdopFilter',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const DecoratedBoxPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'DecoratedBox',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const ConstrainedBoxPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Overflow',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const FittedBoxPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'FittedBox',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const SimpleDialogPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'SimpleDialog',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => const GeolocatorPage(),
                ),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Geolocator',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const SearchPage()),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Search',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const ChipsPage()),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Chips',
          ),
          TagMenuItem(
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const GalleryPage()),
              );
            },
            icon: const Icon(Icons.add),
            text: 'Gallery',
          ),
        ],
      ),
    );
  }
}
